package com.gec.zhs.exception;

import com.gec.zhs.utils.ResultCodeEnum;
import lombok.Data;

/**
 * @author zhs
 * @version 1.0
 * @date 2025-08-25
 * @description
 */
@Data
public class ZhsException extends RuntimeException {
    private Integer code;

    private String msg;

    public ZhsException() {

    }

    public ZhsException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public ZhsException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMsg());
        this.code = resultCodeEnum.getCode();
        this.msg = resultCodeEnum.getMsg();
    }

    public ZhsException(String msg) {
        super(msg);
        this.code = ResultCodeEnum.SERVICE_ERROR.getCode();
        this.msg = msg;
    }

}
